const Router = require('koa-router')

const router = new Router({prefix:'/orders'})

const { auth } = require('../middleware/auth.middleware')
const {Validator} = require('../middleware/order.middleware')
const {create,findAll} = require('../controller/order.controller')
const { update } = require('../controller/order.controller')

router.post('/',auth,Validator({
    address_id:'int',
    goods_info:'string',
    total:'string'
}),create),
router.get('/',auth,findAll)
router.patch('/:id',auth,Validator({
    status:'number'
}),update)

module.exports = router